package com.yao.mall.service;

import com.yao.mall.common.IdRequest;
import com.yao.mall.model.dto.shoppingCart.ShoppingCartAddRequest;
import com.yao.mall.model.dto.shoppingCart.ShoppingCartUpdateRequest;
import com.yao.mall.model.entity.ShoppingCart;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yao.mall.model.vo.ShoppingCartVO;

import java.util.List;

/**
* @author jiahua.yao
* @description 针对表【shopping_cart】的数据库操作Service
* @date 2024-03-26 19:31:12
*/
public interface ShoppingCartService extends IService<ShoppingCart> {

    /**
     * 将商品加入购物车
     * @param cartAddRequest dto
     * @return boolean
     */
    Boolean addGoodsToCart(ShoppingCartAddRequest cartAddRequest);

    /**
     * toShoppingCartVO
     * @return List<ShoppingCartVO>
     */
    List<ShoppingCartVO> toShoppingCartVO(List<ShoppingCart> shoppingCarts);

    /**
     * 更新购物车数据
     * @param cartUpdateRequest updateDTO
     * @return boolean
     */
    Boolean updateCartGoods(ShoppingCartUpdateRequest cartUpdateRequest);

    /**
     * 删除购物车信息
     * @param ids idList
     * @return boolean
     */
    Boolean deleteCartGoods(List<Long> ids);

    /**
     * 批量添加商品到购物车
     * @param cartAddRequestList 批量list
     * @return boolean
     */
    Boolean addGoodsListToCart(List<ShoppingCartAddRequest> cartAddRequestList);

    /**
     * 获取购物车信息
     * @return
     */
    List<ShoppingCartVO> getShoppingCart();

}
